const express = require('express');
const router = express.Router();
const socialController = require('../controllers/socialController');
const { authenticate } = require('../middleware/auth');

// 所有路由都需要认证
router.use(authenticate);

router.get('/leaderboard', socialController.getLeaderboard);
router.get('/rank', socialController.getUserRank);
router.get('/search', socialController.searchUsers);
router.post('/friends/add', socialController.addFriend);
router.get('/friends', socialController.getFriendsList);
router.get('/friends/requests', socialController.getFriendRequests);
router.post('/friends/handle', socialController.handleFriendRequest);

module.exports = router;

